//
//  HHDiscoverController.m
//  oschina
//
//  Created by hjl on 16/3/30.
//  Copyright © 2016年 hjl. All rights reserved.
//

#import "HHDiscoverController.h"
#import "HHDiscoverCell.h"


@interface HHDiscoverController ()

@end

@implementation HHDiscoverController

- (void)viewDidLoad {
    [super viewDidLoad];

    // 注册cell
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([HHDiscoverCell class]) bundle:nil] forCellReuseIdentifier:@"HHDiscoverCell"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    if (section == 0) {
        return 1;
    }else if (section == 1) {
        return 2;
    }else{
        return 2;
    }
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    HHDiscoverCell *cell = [tableView dequeueReusableCellWithIdentifier:@"HHDiscoverCell" forIndexPath:indexPath];
    
    if (indexPath.section == 0) {
        cell.nameLabel.text = @"好友圈";
        cell.iconImage.image = [UIImage imageNamed:@"discover-events"];
    }else if (indexPath.section == 1){
        if (indexPath.row == 0) {
            cell.nameLabel.text = @"找人";
            cell.iconImage.image = [UIImage imageNamed:@"discover-search"];
        }else{
            cell.nameLabel.text = @"活动";
            cell.iconImage.image = [UIImage imageNamed:@"discover-activities"];
        }
    }else{
        if (indexPath.row == 0) {
            cell.nameLabel.text = @"扫一扫";
            cell.iconImage.image = [UIImage imageNamed:@"discover-scan"];
        }else{
            cell.nameLabel.text = @"摇一摇";
            cell.iconImage.image = [UIImage imageNamed:@"discover-shake"];
        }
    }
    
    return cell;
}




@end
